package com.suda.service.impl;

import com.suda.entity.User;
import com.suda.mapper.UserMapper;
import com.suda.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService{

    @Autowired
    private UserMapper userMapper;

    @Override
    public User login(User user) {
        User userDB = this.userMapper.login(user);
        if(userDB != null){
            return userDB;
        }
        throw new RuntimeException("登录失败");
    }
}
